/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.configv2.provider;


import java.util.Collection;
import java.util.List;

import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.ResourceLocator;

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.taobao.ibatiside.model.configv2.Configv2Package;
import org.taobao.ibatiside.model.configv2.SettingsType;

/**
 * This is the item provider adapter for a {@link org.taobao.ibatiside.model.configv2.SettingsType} object.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public class SettingsTypeItemProvider
	extends ItemProviderAdapter
	implements
		IEditingDomainItemProvider,
		IStructuredItemContentProvider,
		ITreeItemContentProvider,
		IItemLabelProvider,
		IItemPropertySource {
	/**
	 * This constructs an instance from a factory and a notifier.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SettingsTypeItemProvider(AdapterFactory adapterFactory) {
		super(adapterFactory);
	}

	/**
	 * This returns the property descriptors for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
		if (itemPropertyDescriptors == null) {
			super.getPropertyDescriptors(object);

			addCacheModelsEnabledPropertyDescriptor(object);
			addClassInfoCacheEnabledPropertyDescriptor(object);
			addDefaultStatementTimeoutPropertyDescriptor(object);
			addEnhancementEnabledPropertyDescriptor(object);
			addErrorTracingEnabledPropertyDescriptor(object);
			addForceMultipleResultSetSupportPropertyDescriptor(object);
			addLazyLoadingEnabledPropertyDescriptor(object);
			addMaxRequestsPropertyDescriptor(object);
			addMaxSessionsPropertyDescriptor(object);
			addMaxTransactionsPropertyDescriptor(object);
			addStatementCachingEnabledPropertyDescriptor(object);
			addUseColumnLabelPropertyDescriptor(object);
			addUseStatementNamespacesPropertyDescriptor(object);
		}
		return itemPropertyDescriptors;
	}

	/**
	 * This adds a property descriptor for the Cache Models Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addCacheModelsEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_cacheModelsEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_cacheModelsEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__CACHE_MODELS_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Class Info Cache Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addClassInfoCacheEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_classInfoCacheEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_classInfoCacheEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__CLASS_INFO_CACHE_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Default Statement Timeout feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addDefaultStatementTimeoutPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_defaultStatementTimeout_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_defaultStatementTimeout_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__DEFAULT_STATEMENT_TIMEOUT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Enhancement Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addEnhancementEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_enhancementEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_enhancementEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__ENHANCEMENT_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Error Tracing Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addErrorTracingEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_errorTracingEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_errorTracingEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__ERROR_TRACING_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Force Multiple Result Set Support feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addForceMultipleResultSetSupportPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_forceMultipleResultSetSupport_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_forceMultipleResultSetSupport_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__FORCE_MULTIPLE_RESULT_SET_SUPPORT,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Lazy Loading Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addLazyLoadingEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_lazyLoadingEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_lazyLoadingEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__LAZY_LOADING_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Max Requests feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addMaxRequestsPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_maxRequests_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_maxRequests_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__MAX_REQUESTS,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Max Sessions feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addMaxSessionsPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_maxSessions_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_maxSessions_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__MAX_SESSIONS,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Max Transactions feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addMaxTransactionsPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_maxTransactions_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_maxTransactions_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__MAX_TRANSACTIONS,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Statement Caching Enabled feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addStatementCachingEnabledPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_statementCachingEnabled_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_statementCachingEnabled_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__STATEMENT_CACHING_ENABLED,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Use Column Label feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addUseColumnLabelPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_useColumnLabel_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_useColumnLabel_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__USE_COLUMN_LABEL,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This adds a property descriptor for the Use Statement Namespaces feature.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected void addUseStatementNamespacesPropertyDescriptor(Object object) {
		itemPropertyDescriptors.add
			(createItemPropertyDescriptor
				(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
				 getResourceLocator(),
				 getString("_UI_SettingsType_useStatementNamespaces_feature"),
				 getString("_UI_PropertyDescriptor_description", "_UI_SettingsType_useStatementNamespaces_feature", "_UI_SettingsType_type"),
				 Configv2Package.Literals.SETTINGS_TYPE__USE_STATEMENT_NAMESPACES,
				 true,
				 false,
				 false,
				 ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
				 null,
				 null));
	}

	/**
	 * This returns SettingsType.gif.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object getImage(Object object) {
		return overlayImage(object, getResourceLocator().getImage("full/obj16/SettingsType"));
	}

	/**
	 * This returns the label text for the adapted class.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String getText(Object object) {
		SettingsType settingsType = (SettingsType)object;
		return getString("_UI_SettingsType_type") + " " + settingsType.isUseStatementNamespaces();
	}

	/**
	 * This handles model notifications by calling {@link #updateChildren} to update any cached
	 * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void notifyChanged(Notification notification) {
		updateChildren(notification);

		switch (notification.getFeatureID(SettingsType.class)) {
			case Configv2Package.SETTINGS_TYPE__CACHE_MODELS_ENABLED:
			case Configv2Package.SETTINGS_TYPE__CLASS_INFO_CACHE_ENABLED:
			case Configv2Package.SETTINGS_TYPE__DEFAULT_STATEMENT_TIMEOUT:
			case Configv2Package.SETTINGS_TYPE__ENHANCEMENT_ENABLED:
			case Configv2Package.SETTINGS_TYPE__ERROR_TRACING_ENABLED:
			case Configv2Package.SETTINGS_TYPE__FORCE_MULTIPLE_RESULT_SET_SUPPORT:
			case Configv2Package.SETTINGS_TYPE__LAZY_LOADING_ENABLED:
			case Configv2Package.SETTINGS_TYPE__MAX_REQUESTS:
			case Configv2Package.SETTINGS_TYPE__MAX_SESSIONS:
			case Configv2Package.SETTINGS_TYPE__MAX_TRANSACTIONS:
			case Configv2Package.SETTINGS_TYPE__STATEMENT_CACHING_ENABLED:
			case Configv2Package.SETTINGS_TYPE__USE_COLUMN_LABEL:
			case Configv2Package.SETTINGS_TYPE__USE_STATEMENT_NAMESPACES:
				fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
				return;
		}
		super.notifyChanged(notification);
	}

	/**
	 * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
	 * that can be created under this object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
		super.collectNewChildDescriptors(newChildDescriptors, object);
	}

	/**
	 * Return the resource locator for this item provider's resources.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public ResourceLocator getResourceLocator() {
		return Config2EditPlugin.INSTANCE;
	}

}
